<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Product
 *
 * @author Windy
 */
class Product_Models_Entities_Product extends Tomato_Model_Entity {

    protected $_properties = array(
        'id' => null, /** Id of article */
        'category_id' => null, /** category_id of article * */
        'name' => null, /** Main title of article */
        'slug' => null, /** Slug of article */
        'description' => null, /** Description of article */
        'specification' => null, /** Content of article */
        'price' => 0, /** Article icons */
        'featured' => 0,
        /**
         * URL of thumbnail image that represent article
         */
        'image_square' => null, /** The thumbnail in square size */
        'image_thumbnail' => null, /** Thumbnail size */
        'image_small' => null, /** Small size */
        'image_crop' => null, /** Crop size */
        'image_medium' => null, /** Medium size */
        'image_large' => null, /** Large size */
        /**
         * Article's status. Can be one of following values:
         * - active
         * - inactive
         * - draft
         * - deleted
         */
        'status' => 'inactived',
        'num_views' => 0, /** Number of views */
        'num_dowload' => 0,
        'attachment' => 0,
        'created_date' => null, /** Article's creation date */
        'created_user_id' => null, /** Id of user who create article */
        'created_user_name' => null, /** Username of user who create article */
        'updated_date' => null, /** Article's modification date */
        'updated_user_id' => null, /** Id of user who update article */
        'updated_user_name' => null, /** Username of user who update article */
        'activated_date' => null, /** Article's activation date */
        'activate_user_id' => null, /** Id of user who activate article */
        'activate_user_name' => null, /** Username of user who activate article */
        'author' => null, /** Author of article */
        'allow_comment' => 0, /** Defines that user can comment on article or not */
        //'sticky' 			 => 0,		/** Defines that article is sticky of main category or not */
        'language' => null, /** Language of article (@since 2.0.8) */
        'meta_title' => null,
        'meta_description' => null,
        'meta_keywords' => null,
        'demo_url' => null
    );

    public function getProperties() {
        $pros = $this->_properties;

        /**
         * Allow user to use {year}, {month}, {day} in article URL
         * @since 2.0.7
         */
        $date = $this->_properties['created_date'];
        if (null == $date) {
            $pros['year'] = date('Y');
            $pros['month'] = date('m');
            $pros['day'] = date('d');
        } else {
            $timestamp = strtotime($date);
            $pros['year'] = date('Y', $timestamp);
            $pros['month'] = date('m', $timestamp);
            $pros['day'] = date('d', $timestamp);
        }

        return $pros;
    }

}

?>
